<style>
.content-group {background:#fff;border-radius: 0.5rem;margin-bottom:0.39rem}
.merchname {display:none}
.fui-tab-scroll .item a {color:#fff;font-weight:400}
.fui-tab-scroll .item.on,.fui-tab-scroll .item.on a{color:#fff;}
.fui-tab-scroll .item.on:before {background:linear-gradient(to right,rgba(255,255,255,1),rgba(255,255,255,0));}
.fui-icon-group .fui-icon-col {
    margin: 0.1rem 0;
}
.carousel {margin-top:0}
.fui-header:after {
	border-bottom: 0 solid #D9D9D9;
}
</style>
<div ng-include="sys_html('common/_header','','','jy_weishop')"></div>
<div class="fui-page fui-page-current page-goods-list">
<div class='fui-content' style="top:0">
	<div class="topbg" style="position: relative;text-align:center;width:100%;height:4.5rem;background: linear-gradient(#7c2fef, #8549f7);">
		<div class="fui-header" style="background:none">
			<div class="fui-header-left" style="padding-left:0.5rem">
				<img style="height:1.2rem" ng-src="{{tomedia(pagedata.sale_lige.logo) || '../addons/jy_weishop/resource/images/livelogo.png'}}"/>
			</div>
			<div class="title"></div>
			<div class="fui-header-right" style="padding-right:0.5rem;color:#fff">
				<i class="icon jinyunicon icon-fenxiang2" onclick="$('#showsharecover').modal();" style="font-size: 1rem;margin-right:10px"></i>
				<i class="icon jinyunicon icon-liaotian" ng-click="access_json('jy_weishop/member.index/')" style="font-size: 1rem;"></i>
			</div>
		</div>
		<div class="fui-searchbar bar" style="background:none;z-index: 0;top:2rem">
				<div ng-class="{'searchbar':1,'searchbar-active':pagedata.searchbar ==1}" style="background:none">
						<div style="position: relative;left:0;top:0;">
							<div class="search-input" style="">
								<i id="searchsub" class="icon icon-sousuo1" ng-click="access_json('jy_weishop/sale.live_index/getlist/name='+pagedata.params.keyword)"></i>
								<input type="search" placeholder="搜索房间" class="search" ng-model="pagedata.params.keyword" style="text-align: left; color: #999; font-size:0.6rem;background:#f9f9f9;border-radius: 1rem;" />
							</div>
						</div>
				</div>
		</div>
	</div>
	<div style="background: linear-gradient(#8549f7, #a558e2);padding-bottom:4rem"> 
		<div class="fui-tab-scroll" ng-if="pagedata.p_group.length>0">
			<div style="height:2rem;line-height:1.5rem" ng-class="{'item':1,'on':pagedata.params.pid==0}"><a href="javascript:;" ng-click="pagedata.params.pid=0;tool.get_list('jy_weishop/sale.live_index/getlist/order=ishot',true)">热门直播</a></div>
			<div ng-class="{'item':1,'on':pagedata.params.pid==1}" style="height:2rem;line-height:1.5rem"><a href="javascript:;" ng-click="pagedata.params.pid=1;pagedata.groupkey=$index;tool.get_list('jy_weishop/sale.live_index/getlist/',true)">女主播</a></div>
			<div ng-class="{'item':1,'on':pagedata.params.pid==2}" style="height:2rem;line-height:1.5rem"><a href="javascript:;" ng-click="pagedata.params.pid=2;pagedata.groupkey=$index;tool.get_list('jy_weishop/sale.live_index/getlist/',true)">男主播</a></div>
			<div ng-class="{'item':1,'on':pagedata.params.pid==3}" style="height:2rem;line-height:1.5rem"><a href="javascript:;" ng-click="pagedata.params.pid=3;pagedata.groupkey=$index;tool.get_list('jy_weishop/sale.live_index/getlist/',true)">成交额</a></div>
			<div ng-class="{'item':1,'on':pagedata.params.pid==4}" style="height:2rem;line-height:1.5rem"><a href="javascript:;" ng-click="pagedata.params.pid=4;pagedata.groupkey=$index;tool.get_list('jy_weishop/sale.live_index/getlist/',true)">拉新量</a></div>
			<div ng-class="{'item':1,'on':pagedata.params.pid==-1}" style="height:2rem;line-height:1.5rem"><a href="javascript:;" ng-click="pagedata.params.pid=-1;pagedata.groupkey=$index;tool.get_list('jy_weishop/sale.live_index/getlist/',true)">其他</a></div>
		</div>
		<div style="position: absolute;width:100%;height:2rem;margin-top:2rem;background-color:#fff;border-top-right-radius:100% 2rem;border-top-left-radius:100% 2rem;">
		</div>
	</div>
	<div ng-if="pagedata.setting.hdps.length>0" class="radius" style="padding:0 1rem; margin-top:-6rem">
		<style>
		.carousel {margin-top:2.2rem}
		.margin-top0 {margin-top:0}
		.radius .carousel-inner {border-radius:0.2rem}
		</style>
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true" ng-if="pagedata.setting.hdps">
			<div class="carousel-inner" role="listbox">
				<div ng-repeat="nav in pagedata.setting.hdps" ng-class="{'item':1, 'active':$index==0}" >
					<a ng-click="access_json(nav.url)">
						<img ng-src="{{tomedia(nav.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 0.2rem; bottom: 0.2rem; ">
				<div class="fui-swipe-bullet" ng-repeat="nav in pagedata.setting.hdps" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<script>
			require(['bootstrap', 'hammer'], function($, Hammer){
				$('#carousel-container').carousel();
				var mc = new Hammer($('#carousel-container').get(0));
				mc.on("panleft", function(ev) {
					$('#carousel-container').carousel('next');
				});
				mc.on("panright", function(ev) {
					$('#carousel-container').carousel('prev');
				});
			});
		</script>
	</div>
	<div ng-if="pagedata.params.pid==0 && pagedata.setting.bankuai.length>0" class="fui-icon-group noborder col-5 radius" style="background: #ffffff">
		<a class="fui-icon-col external" ng-repeat="item in pagedata.setting.bankuai" href="javascript:;" ng-click="access_json(item.action)" data-nocache="true">
				<div class="icon"><img ng-src="{{tomedia(item.img) || '../core/resource/images/diy/icon/icon_goods.png'}}" style="height:auto"></div>
				<div class="text" style="padding-bottom:0">{{item.title}}</div>
				<div class="subtitle">{{item.desc}}</div>
		</a>
	</div>
	<div ng-if="pagedata.params.pid!=0 && pagedata.p_group[pagedata.groupkey].c_group.length>0" style="background: linear-gradient(#9b6bf7, #f2f2f2);padding: 0.3rem;width:100%">
		<div class="fui-icon-group noborder col-5 radius"  style="padding-top:0.3rem;background: #ffffff">
			   <div class="fui-icon-col external" ng-repeat="item in pagedata.p_group[pagedata.groupkey].c_group" style="margin:0" ng-click="access_json('/goods.index//cid='+item.id)">
					<div class="badge" style="background-color: #f60;"></div>
					<div class="icon icon-green radius" style="height:36px;line-height:36px"><img style="width:36px;height:36px" ng-src="{{tomedia(item.image) || '../core/resource/images/diy/icon/icon_goods.png'}}"/></div>
					<div class="text" style="font-size:0.55rem;">{{item.title}}</div>
			   </div>
		</div>
	</div>
	<div class='btn block btn-submit' ng-click="access_json('jy_weishop/sale.live_myrooms/')" style="background:linear-gradient(to right,rgba(124,47,239,1),rgba(165,88,226,1));color:#fff;margin:0.5rem 1rem;border-radius:1.8rem;line-height:1.8rem">进入我的直播间</div>
	<div class='btn block btn-submit' ng-click="access_json('jy_weishop/sale.live_lookjiang/')" style="color:#a558e2;border: 1px solid #a558e2;margin:0.55rem 1rem;border-radius:1.8rem;line-height:1.8rem">看直播有奖</div>
	<div ng-if="pagedata.sale_live.no_roomlist!=1" style="margin-top:-0.2rem" ng-include="sys_html('shop/_livegoods')"></div>
</div>
</div>
<!--分享弹层-->
<div id="showsharecover" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div id="cover">
		<div class='fui-mask-m visible'></div>
		<div class='arrow'></div>
		<div ng-if="!pagedata.goods.share_title" class='content'>请点击右上角<br/>通过【发送给朋友】<br/>邀请好友观看！！</div>
	</div>
</div>
</div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<div ng-include="sys_html('common/_footer')"></div>
<div ng-include="sys_html('common/_coupon',true)"></div>
<div ng-include="sys_html('common/_h5game',true)"></div>
<div ng-include="sys_html('common/_gotop',true)"></div>
<div ng-if="pagedata.showtanmus && !pagedata.setting.no_tanmu" class="video-sms-pane {{pagedata.transition?'transition':''}}">
		<div class="video-sms-text">
			<image class="video-sms-logo" src="{{pagedata.tanmus[pagedata.nowmsgid].avatar}}"/>
			<span class="overflow-h"> 最新订单来自 {{pagedata.tanmus[pagedata.nowmsgid].nickname}}</span>
		</div>
</div>
<script>
scope.pagedata.issocketmsg=false;
scope.pagedata.tanmuspage=0;
scope.pagedata.nowmsgid=0;
scope.pagedata.gettanmus=function() {
	if(!scope.pagedata.issocketmsg){
			scope.get('jy_weishop/get_data/gettanmus/page='+scope.pagedata.tanmuspage,function(res){
						//console.log(res);
						scope.pagedata.tanmus=res.list
						if(scope.pagedata.tanmus.length>0){
							scope.pagedata.tanmuspage++;
							scope.pagedata.up_oldtanmu();
						}
			});
	}
}
//前端先注册以等待接收消息
//刚进入时；如果没有新订单消息，就弹储备订单消息
if(scope.pagedata.setting.no_tanmu!=1){
		setTimeout(function(){
			scope.pagedata.gettanmus();
		},2000);
}
scope.pagedata.up_oldtanmu=function() {
		if(scope.page.action=='index'){
			var i=scope.pagedata.nowmsgid;
			if(i<scope.pagedata.tanmus.length){
				set_tanmu(scope.pagedata.tanmus[i].nickname,scope.pagedata.tanmus[i].avatar,scope.pagedata.tanmus[i].time);
			}else{
				scope.pagedata.gettanmus();
			}
		}else{
			return false;
		}
}
function set_tanmu(nickname,avatar,time) {
		scope.pagedata.nowmsgid++
		scope.pagedata.showtanmus=true
		scope.$evalAsync(scope.pagedata.showtanmus);
		setTimeout(function(){
			scope.pagedata.transition=true
			scope.$evalAsync(scope.pagedata.transition);	
		},300);
		setTimeout(function(){
			scope.pagedata.showtanmus=false
			scope.pagedata.transition=false
			scope.$evalAsync(scope.pagedata.showtanmus);	
		},2000);
		setTimeout(function(){
			//等待5秒，如果没有新的订单消息，就弹储备订单消息
			scope.pagedata.issocketmsg=scope.pagedata.issocketmsg?scope.pagedata.issocketmsg:false;
			if(!scope.pagedata.issocketmsg && scope.page.action=='index'){
				scope.pagedata.up_oldtanmu();
			}
		},4000);
}
</script>
<script>
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>